const Koa=require('koa')
const app=new Koa()
app.use(async (ctx,next)=>{
    console.log(1)//第一个打印
    await next()
    console.log(2)//第三个打印
})
app.use(async (ctx,next)=>{
    console.log(3)//第二个打印
    await next()
    setTimeout(()=>{
        console.log(4)//第六个打印
    },6000)
})
app.use(async (ctx,next)=>{
    setTimeout(()=>{
        console.log(5)//第四个打印
    },3000)
    setTimeout(()=>{
        console.log(6)//第五个打印
    },6001)
})

app.listen(3000)